﻿/// <reference path="../Controls/BaseComplexValueControl.js" />

TA.Turbo.Controls.BaseEntityControl = function BaseEntityControl(clientId)
{
	this.BaseComplexValueControl(clientId);
}
var $BaseEntityControl = TA.Turbo.Controls.BaseEntityControl;
$BaseEntityControl.Inherit($BaseComplexValueControl);

var ____a;
if (____a)
{
	$BaseEntityControl.prototype = new $BaseComplexValueControl();
	$BaseEntityControl.prototype.BaseComplexValueControl = new $BaseComplexValueControl();
}

$PropertyDefinition.Define($BaseEntityControl, "ChildId", "CI", "");


$BaseEntityControl.prototype.get_Child = function get_Child()
{
	if (String.IsNullOrEmpty(this.get_ChildId())) return null;
	return document.getElementById(this.get_ChildId());
}

$BaseEntityControl.prototype.get_Value = function get_Value()
{
	return this.get_Child().get_Object().get_Value();
}
$BaseEntityControl.prototype.set_Value = function set_Value(value)
{
	this.get_Child().get_Object().set_Value(value);
}


$BaseEntityControl.prototype.Init = function Init()
{
	this.BaseComplexValueControl.Init.call(this);
}
$BaseEntityControl.prototype.Load = function Load()
{
	this.BaseComplexValueControl.Load.call(this);

	this.get_Child().get_Object().AddEvent("ValueChanged", this._Child_ValueChanged, this);
}

$BaseEntityControl.prototype._Child_ValueChanged = function _Child_ValueChanged()
{
	this._OnValueChanged();
}